﻿@model List<NFine.Domain.ViewModel.GroupMembersModel>

<!DOCTYPE html>
<html>
<head>
    <title>@ViewBag.Title</title>
    <link href="~/Content/css/framework-font.css" rel="stylesheet" />
    <link href="~/Content/css/framework-theme.css" rel="stylesheet" />
    <script src="~/Content/js/jquery/jquery-2.1.1.min.js"></script>
    <script src="~/Content/js/bootstrap/bootstrap.js"></script>
    <link href="~/Content/js/bootstrap/bootstrap.min.css" rel="stylesheet" />
    <link href="~/Content/css/framework-ui.css" rel="stylesheet" />
    <script src="~/Content/js/framework-ui.js"></script>
    <style type="text/css">
        * {
            font-family: "微软雅黑";
            font-size: 14px;
        }
        body {
            margin: 0;
            padding: 0;
        }
        section {
            margin: 3px 10px 3px 10px;
            padding: 3px 10px 3px 10px;
        }
        .dome-bg {
            padding: 3px;
            background: #fff;
            border-radius: 3px;
            border: 5px solid #00a3e9;
            box-shadow: 0 0 8px #a9acaf;
            overflow: hidden;
        }
        .largebox .dome-bg {
            width: 150px;
            height: 80px;
        }
        .littlebox .dome-bg {
            width: 130px;
            height: 70px;
        }
        .littlebox .dome-bg span {
            font-size: 11px;
        }
        .demo-con h6 {
            text-align: center;
            margin: 0;
            font-size: 16px;
            line-height: 45px;
        }
        .margin15 {
            margin-left: -15px !important;
        }
        .padding-right8 {
            padding-right: 8px;
        }
        /*
        section:nth-child(1) {
            background: #eee;
        }
        section:nth-child(2) {
            background: #ebffdd;
        }
        section:nth-child(3) {
            background: #dde7ff;
        }
        section:nth-child(4) {
            background: #ffdddd;
        }
        */
        .infobox {
            float: left;
            text-align: center;
            line-height: 25px;
        }

        .largebox .infobox {
            width: 160px;
        }

        .littlebox .infobox {
            width: 140px;
        }
        section .row{
            margin: 0;
        }
        .largebox {
            min-height: 80px;
        }
        .littlebox {
            min-height: 70px;
        }
        .textspan {
            padding-left: 0px;
            padding-right: 0px;
        }

        .currentuser {
            color: #44f90c;
        }
        .h4padding {
            padding-right: 0px;
            padding-left: 0px;
        }
    </style>
    <script type="text/javascript" >
        function search() {
            var newhref = "@Url.Content("~/BusinessManage/D_GroupMember/GroupMembers/")" + $("#txt_keyword").val();
            $("#searchBtn").attr("href", newhref)
        }

        function onchecked() {
            if ($("#openNewWin").is(':checked'))
                $("#searchBtn").attr("target", "_blank");
            else
                $("#searchBtn").attr("target", "");
        }

    </script>
</head>
<body>
    <div class="search">
        <table>
            <tr>
                <td>
                    <div class="input-group">
                        <input id="txt_keyword" type="text" class="form-control" oninput="search()" placeholder="会员ID" style="width: 200px;">
                        <span class="input-group-btn">
                            <a class="btn btn-primary" id="searchBtn"  href="" target="" ><span class="glyphicon glyphicon-search"></span></a>
                        </span>
                        <div class="ckbox" style="margin-left:6px;" >
                            <input id="openNewWin" name="openNewWin" type="checkbox" onclick="onchecked()" ><label for="openNewWin">打开新页面</label>
                        </div>
                    </div>
                </td>
            </tr>
        </table>
    </div>
    <h4 style="text-align:center;" >@(Model.FirstOrDefault().GroupMember.IsOperator ? "经营组" : "消费组")</h4>
@for (int i = 0; i < 4; i++)
{
    string bgcolor = "";
    string bdcolor = "";
    switch (i)
    {
        case 0:
            bgcolor = "#e4eac1";
            bdcolor = "#ded78b";
            break;
        case 1:
            bgcolor = "#f5db90";
            bdcolor = "#f58c45";
            break;
        case 2:
            bgcolor = "#bfd9f7";
            bdcolor = "#5a99de";
            break;
        case 3:
            bgcolor = "#a2f1a7";
            bdcolor = "#5dd064";
            break;
    }
    <section style="background-color:@bgcolor;" >
        <div class="row @(i == 3 ? "littlebox" : "largebox")" >
        @foreach (var item in Model)
        {
            if (item.GroupMember.GroupStatus == i)
            {
            <div class="infobox padding-right8" title="@item.GroupMember.User.ReferenceName" >
                <div class="dome-bg" style="border-color:@bdcolor;" >
                    <div style="display:none;" >@Html.Raw(Json.Encode(item))</div>
                    <h4 class="col-md-12 @(i == 3 ? "h6" : "h4") h4padding" >@if (item.GroupMember.User.CurrentManagerType >= 2)
                    { <sup style="color:red;font-size:14px;">^</sup>} <a class=" @(item.GroupMember.MemberID == ViewBag.CurrentUserID ? "currentuser" : "" ) " href="~/BusinessManage/D_GroupMember/GroupMembers/@item.GroupMember.MemberName" target="_blank">@item.GroupMember.MemberName</a> <sub style="color: #1931ea;">@item.GroupMember.Amount</sub></h4>
                    <span class="col-xs-6 col-md-6 textspan" > @{
                            var sub = item.Subordinates.ElementAtOrDefault(0);
                            if (sub != null)
                            {
                                <text>@if (sub.IsJinsuo) {<sup style="color:red;font-size:14px;" >*</sup>}<a href="~/BusinessManage/D_GroupMember/GroupMembers/@sub.MemberName" target="_blank">@sub.MemberName</a></text>
                            }
                   }</span>
                    <span class="col-xs-6 col-md-6 textspan" >@{
                            var sub2 = item.Subordinates.ElementAtOrDefault(1);
                            if (sub2 != null)
                            {
                                <text>@if (sub2.IsJinsuo){<sup style="color:red;font-size:14px;" >*</sup>}<a href="~/BusinessManage/D_GroupMember/GroupMembers/@sub2.MemberName" target="_blank">@sub2.MemberName</a></text>
                            }
                   }</span>
                </div>
            </div>
            }
        }
        </div>
    </section>
}
</body>
</html>
